<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
	</head>
	<body></body>
	<script src="js/jquery-3.0.0.min.js" type="text/javascript" charset="utf-8"></script>
	 <script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/core.js"></script>

	<script type="text/javascript">
		$(function(){	
				var code=getvl("code");
			//var parameterVal = getvl("parameterVal");
			if(getvl("types")=='y'){
				window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx242f8ebb59f20be1&redirect_uri=http://wx.jiagangwangluo.com/wx/1.3.0zhuce.html&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
			}else if(getvl("types")=='d'){
			window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx242f8ebb59f20be1&redirect_uri=http://wx.jiagangwangluo.com/wx/gotoindex.html&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
			}else if(code!=""){
					if(sessionStorage.getItem("phone")!=""){
			//sessionStorage.setItem("codess",codess);
		 $.ajax({
				url: urlcore + "/api/user/wxupdate?codess="+code,
				type: "post",
				contentType: "application/json;charset=utf-8",
				data: JSON.stringify({ //所在省市
					"password": sessionStorage.getItem("password"),
					"phone": sessionStorage.getItem("phone")
				}),
				dataType: "json",
				success: function(data) {
					//data是返回的hash,key之类的值，key是定义的文件名
					//alert(JSON.stringify(data.data));
					//	window.location.href="8.0.0zhaohuo.html";
					if(data.success == true) {
						//alert(JSON.stringify(data.data.jsonObject));
			          //toLogin(data.data.phone,data.data.password);
                  window.location.href = "gotoindex.html";
					} else{
					alert(data.msg);
				    }
				},
				error: function() {
					alert("修改失败");
				}
			});
	          }else{
	          	window.opener=null;
              window.open('','_self');
                window.close();
	          }
			}else if(getvl("id")!=""){
									sessionStorage.setItem("oderid",getvl("id"));
	window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx242f8ebb59f20be1&redirect_uri=12.8.2buy_dingdan_daikexiadan_detail.html&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";			
		}else{
	window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx242f8ebb59f20be1&redirect_uri=http://wx.jiagangwangluo.com/wx/index.html&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
		}
	
		//window.location="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8b9d4cc8520e4597&redirect_uri=http://cww8090.ngrok.cc/login_index.html&response_type=code&scope=snsapi_userinfo&state="+parameterVal+"&connect_redirect=1#wechat_redirect";
 //window.location="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx242f8ebb59f20be1&redirect_uri=http://www.jumeiclub.com/jumei_html/login_index.html&response_type=code&scope=snsapi_userinfo&state="+parameterVal+"&connect_redirect=1#wechat_redirect";
	    });
	
	



	</script>
</html>